package br.com.os2.pacemark.util;

import java.util.HashMap;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
import net.sf.jasperreports.view.JasperViewer;

/**
 *
 * @author Daniel
 *
 */
public class Report {

    public static void gerarRelatorioDesktop(String nome, HashMap<String, Object> parametros,
            JRBeanCollectionDataSource dados) throws JRException {

        String arquivo = System.getProperty("user.dir") + "/res/RELATORIOS/" + nome;

        JasperPrint jp = JasperFillManager.fillReport(arquivo, parametros, dados);

        JasperViewer.viewReport(jp);

    }
}
